import mx.containers.Panel;
import mx.events.MenuEvent;
import mx.controls.Alert;
import mx.managers.PopUpManager;

private var alert:Alert;
private function createNewWindow(w:Panel):void {
   //w.x = 100 + this.numChildren * 20;
   //w.y = 50 + this.numChildren * 20;
   this.addChild(w); 
}

private   function   defaultMenu():void     
{ 
       		myViewStack.selectedChild=x0;                   
}

private  function   menuHandler(event:MenuEvent):void     
{ 
       if ("1"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x1;
       }if ("2"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x2;
       }
       if ("3"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x3;
       } if ("4"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x4;
       } if ("5"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x5;
       }
       if ("6"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x6;
       }
        if ("7"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x7;
       }
       if ("8"==event.item.@value)
       {
       	
       		myViewStack.selectedChild=x8;
       }
                   
}